package kr.hkit.powerjava.chapter09.work;

class Circle{
	private double radius;
	private static double PI; 
	
	
	public Circle(double radius) {
		this.radius = radius;
	}
	
	static double getPI(){
		return PI = 3.141592;
	}
	
	double getArea(){					//원의 면적 구하는 공식
		return getPI() * square();
	}
	
	double getPerimeter(){			//원의 둘레 구하는 공식
		return radius * 2 * getPI();
	}
	
	double square(){
		return radius * radius;
	}
	
	public double getRadius() {
		return radius;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}
	@Override
	public String toString() {
		return "Circle [radius=" + radius + ", PI=" + PI + ", getArea()="
				+ getArea() + ", getPerimeter()="+ getPerimeter()+"]";
	}	
	

}// end of Circle Class
public class CircleTest {
	public static void main(String[] args) {
		Circle c1 = new Circle(6.5);
		System.out.println(c1);
		System.out.println(c1.square());
		System.out.println(c1.getPI());
	}
}
